package com.xzq.erp.ai.tools;

import com.xzq.erp.domain.query.OrderPageQuery;
import com.xzq.erp.domain.vo.OrderVO;
import com.xzq.erp.service.IOrderService;
import lombok.RequiredArgsConstructor;
import org.springframework.ai.chat.model.ToolContext;
import org.springframework.ai.tool.annotation.Tool;
import org.springframework.ai.tool.annotation.ToolParam;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
@RequiredArgsConstructor
public class OrderTools {

    private final IOrderService orderService;

    // 查询订单信息
    @Tool(name="查询订单信息",description = "查询订单信息")
    public List<OrderVO> getOrderListByQuery(@ToolParam(required = false,description = "查询参数") OrderPageQuery query, ToolContext toolContext) {
        return orderService.getOrderListByQuery(query);
    }
}
